package com.kun.peng.generator.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kun.peng.generator.domain.ColumnInfo;
import com.kun.peng.mybatis.base.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created on 2021/11/17.
 *
 * @author xuebaopeng
 * Description
 */
@Mapper
public interface GenColumnInfoMapper extends MyBaseMapper<ColumnInfo> {


    /**
     * 查询数据库中表的全部表信息
     * @return
     */
    @Select("select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables where table_schema = (select database()) and table_name like #{tableName}  order by create_time desc;")
    Page<ColumnInfo> getTablesFromDataBases(@Param("tableName") String tableName);

}
